package stream;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Stream;

public class Test1 {

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            List<String> stringList = new ArrayList<>();
            stringList.add("help");
            stringList.add("build");
            stringList.add("congratulation");
            stringList.add("toe");
            Stream<Stream<String>> result = stringList.parallelStream().map(s -> letters(s));
            result.forEach(s-> System.out.println(s.toString()));
        }
    }

    private static Stream<String> letters(String s) {
        List<String> result = new ArrayList<>();
        for (int i = 0; i < s.length(); i++)
            result.add(s.substring(i, i+1));
        result.stream().forEach(s1 -> System.out.println(s1));
        return result.stream();
    }


}
